package cn.manyufun.myf.bean;


import com.orm.SugarRecord;
import com.orm.dsl.Unique;

import java.util.Date;

import cn.manyufun.myf.app.AppConstant;

/**
 * Created by Xiao on 2018-02-24.
 */

public class UserSummary extends SugarRecord {


    public String Phone;
    public String Email;
    public int Gender;
    public String NickName;
    public String HeadImgUrl;
    public String Slogan;
    public Date Birthday;
    @Unique
    public String UserToken;
    public String Region;
    public String OpenId;

    public UserSummary() {

    }

    public UserSummary(String phone, String email, int gender, String nickName, String headImgUrl, String slogan, Date birthday, String userToken, String region, String openId) {
        Phone = phone;
        Email = email;
        Gender = gender;
        NickName = nickName;
        HeadImgUrl = headImgUrl;
        Slogan = slogan;
        Birthday = birthday;
        UserToken = userToken;
        Region = region;
        OpenId = openId;
    }

    public String GenderStr() {
        if (Gender == AppConstant.GENDER_MAN)
            return "男";
        else
            return "女";
    }

    public String PhoneStr() {
        return Phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
    }

}
